﻿using ConfExpert.Forms.Base;
using DevTeam;
using System;
using System.Drawing;

namespace ConfExpert.Forms.Depo.OverProduction
{
    public partial class BlokeCoz : XForm
    {
        public BlokeCoz()
        {
            InitializeComponent();
        }

        private void BlokeCoz_Load(object sender, EventArgs e)
        {
            
            gv.Init("GetOPbloke", false);
            gv.OptionsView.EnableAppearanceOddRow = gv.OptionsView.EnableAppearanceEvenRow = false;
            gv.RowCellStyle += new DevExpress.XtraGrid.Views.Grid.RowCellStyleEventHandler(gv_RowCellStyle);
            btnKaydet.ItemClick += btnKaydet_ItemClick;
        }

        void btnKaydet_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            ShowInfoMessage("Griddeki vurgulu topları yeniden işleme almalısınız.");
            gv.RefreshDataSource(true, "GetOPbloke", true);
        }

        void gv_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
        {
            if (e.Column.FieldName.EndsWith("RollId") &&
                e.RowHandle > -1)
                e.Appearance.BackColor = e.Appearance.BackColor2 = Color.SkyBlue;
        }

    }
}